package com.course.android.activity.ac;

import android.content.Intent;
import android.os.Handler;
import android.os.Message;

import androidx.annotation.NonNull;

import com.course.android.R;
import com.course.android.activity.ActivityIntent;
import com.course.android.activity.base.BaseActivity;
import com.course.android.activity.base.BaseNetActivity;
import com.course.controller.ConfigController;
import com.course.model.HttpConfigBean;

import java.util.List;

public class LoadActivity extends BaseNetActivity {

    @Override
    protected void initView() {

    }

    @Override
    protected void initData() {

        ConfigController.getInstance().get(this);
    }

    @Override
    protected int bindLayout() {
        return R.layout.activity_load;
    }

    @Override
    protected void onActivityResultCallBack(Integer reqCode, Intent data) {

    }


    @Override
    public <ConfigResp> void onData(HttpConfigBean flag, ConfigResp o) {
//            ActivityIntent.toHomeIntent(newIntentLauncher(),this);
            ActivityIntent.toHomeIntent(newIntentLauncher(),this);
            finish();
    }

    @Override
    public void onReqFail(HttpConfigBean flag, Exception e, String errorMsg) {
        super.onReqFail(flag, e, errorMsg);
//        ActivityIntent.toHomeIntent(newIntentLauncher(),this);
        ActivityIntent.toHomeIntent(newIntentLauncher(),this);
        finish();
    }

    @Override
    public <T> void onPageData(HttpConfigBean flag, int pageNum, int pageSize, int total, List<T> array) {

    }
}
